<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        class="outline-parent-bg"
        :src="publicUrls + 'free/style13/Level2outlineStyle6Bg.webp'"
        alt=""
      />
      <div class="outline">
        <div
          class="outline-content"
          :class="!props.info.value && !props.info.subTitle && !props.info.remarks && 'outline-start'"
        >
          <div class="outline-text1" v-if="props.info.text.length >= 5">
            {{ props.info.text.slice(0, -4) }}
          </div>
          <div class="outline-text" :class="props.info.text.length < 5 && 'outline-text2'">
            <p v-for="item in props.info.text.slice(-4)" :key="item">{{ item }}</p>
          </div>
        </div>
        <div
          class="content-box-left"
          :class="!props.info.subTitle && !props.info.value && 'content-box-text'"
          v-if="props.info.subTitle || props.info.remarks || props.info.value"
        >
          <div class="outline-subTitle" :class="!props.info.value && 'subTitle'" v-if="props.info.subTitle">
            {{ props.info.subTitle }}
          </div>
          <div class="cover" @click="ImgVisible = true" v-if="props.info.value">
            <img class="outline-cover" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
          </div>
          <TextMax
            v-if="props.domShow"
            :infoData="props.info"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="
              props.info.value
                ? 2
                : !props.info.value && props.info.subTitle
                ? 4
                : !props.info.value && !props.info.subTitle && 5
            "
          ></TextMax>
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline2Shadow.webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free13Style6',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style13.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const flag = ref(false);
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 280px;
}
.shadow {
  width: 560px;
  height: 188px;
  position: absolute;
  bottom: -30px;
  left: 0;
}
.flex-box {
  width: 430px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 19;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  z-index: 20;
  display: flex;
  align-items: end;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 20;
  padding-left: 50px;
}
.outline-start {
  width: 100% !important;
  height: 100%;
  // left: 150px !important;
  // top: 50% !important;
  // transform: translateY(-50%);
  position: relative !important;
  padding-bottom: 117px;
  padding-top: 140px;
  padding-left: 58px;
  .outline-text2 {
    margin-left: 18px;
  }
}

.outline-content {
  width: 24px;
  position: absolute;
  left: 50px;
  top: 40px;
  display: flex;
  .outline-text1 {
    font-family: SourceHanSerifCN-Bold;
    font-size: 24px;
    color: #333333;
    line-height: 24px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 5px;
    margin-right: 18px;
  }
  .outline-text {
    // position: absolute;
    // left: 48px;
    // top: 0;
    ::v-deep p {
      font-family: Slidexiaxing;
      font-size: 64px;
      color: #333333;
      line-height: 60px;
      &:nth-child(even) {
        margin-left: -12px;
      }
      &:nth-child(odd) {
        margin-left: 6px;
      }
    }
  }
}
.content-box-text {
  height: 360px !important;
  justify-content: start !important;
}
.content-box-left {
  width: 320px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: end;
  padding-bottom: 117px;
}
.subTitle {
  width: 100% !important;
  margin-bottom: 16px !important;
}
.outline-subTitle {
  width: 180px;
  color: #000000;
  text-align: center;
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  line-height: 28px;
  margin-bottom: 24px;
  opacity: 0.8;
}

.cover {
  width: 100%;
  height: 160px;
  overflow: hidden;
  margin-bottom: 9px;
  background: #c4c4c4;
  &:hover img {
    transform: scale(1.5);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}
.Showroom-parent {
  position: absolute;
  top: 50px;
  right: 60px;
  z-index: 21;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ff0505 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>